<?php

include_once 'admin_access.php';

if(isset($_POST['sm1'])){	
	$pwd = trim($_POST['pwd']);
	$name = $_SESSION['user_name'];
	
	if($pwd == '' || $name == ''){
		echo "<script>alert('提示：密码不能为空！');</script>";
	} else {
		if(DB::update('admin_user', array('pwd' => md5($pwd)), "name = $name")){
			echo "<script>alert('提示：修改成功！');</script>";
		}
	}
}

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="css/base.css">
<link rel="stylesheet" type="text/css" href="css/indexbody.css">

</head>
<body leftmargin="8" topmargin="8" bgcolor="#FFFFFF">
<div style="min-width:780px">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
  <tbody><tr>
    <td>
     <div id="" style="float:right;padding-right:8px;">
     </div>
   </td>
  </tr>
  <tr>
    <td style="padding: 0px;" background="css/sp_bg.gif" height="1"></td>
  </tr>
</tbody></table>
<div id="__testEvn"></div>
<div id="mainmsg">
  <div class="column" id="column1"><!--左侧开始-->    
        <dl class="dbox" id="item1">
            <dt class="lside"><span class="l"> 修改密码</span></dt>
            <dd>
				<form method="post">
				<table>
					<tr>
						<td>新密码：<input type="password" name="pwd"/></td>						
					</tr>
					<tr>
						<td><button type="submit" name="sm1">修改</button></td>						
					</tr>
				</table>
				</form>
            </dd>
        </dl>
    </div>
</div>
<br style="clear:both">
<div class="footer" align="center">
Copyright © 2004-2012
</div>
</div>
</body></html>